import React, { useState, useEffect } from 'react'
import all from "../../../../assets/img/home_1.png"
import juan2 from "../../../../assets/img/home_youhuijuan2.png"
import juan3 from "../../../../assets/img/home_youhuijuan3.png"
import juan1 from "../../../../assets/img/home_youhuijuan1.png"
import juan11 from "../../../../assets/img/home_youhuijuan11.png"
import { reqNewP } from '../../../../request/api'
export default function NewP() {
    let [arr, setArr] = useState([])
    useEffect(() => {
        reqNewP().then(res => {
            setArr(res.list)
        })
    }, [])
    return (
        <div className="beijing">
            {/*新人专享  */}
            <div className="xinren">
                <h3>新人专享</h3>
                <p>05:42:47</p>
                <img src={all} alt="" />
            </div>
            <div className="juan1">
                {/* 一重礼 */}
                <div className="one">
                    <p className="p1">
                        <img src={juan11} alt="" className="img1" />
                        <span>信任特价商品专区</span>
                        <i>(信任供应，先到先得)</i>
                    </p>
                    <ul>
                        {
                            arr.map(item => {
                                return (
                                    <li key={item.id}>
                                        <img src={item.img} alt="" />
                                        <div className="d1">
                                            <p>{item.price}</p>
                                            <del>{item.market_price}</del>
                                        </div>
                                        <div className="d2">
                                            <span className="iconfont">&#xe612;</span>
                                        </div>
                                    </li>
                                )
                            })
                        }
                    </ul>
                </div>
                {/* 二重礼 */}
                <div className="two">
                    <p className="p1">
                        <img src={juan1} alt="" />
                        <span>新人通用50元礼券</span>
                        <i>(下单立减，省了又省)</i>
                    </p>
                    <p>
                        <img src={juan2} alt="" className="img1" />
                        <img src={juan3} alt="" className="img2" />
                    </p>
                </div>
            </div>
        </div>
    )
}
